package com.xiaoyu.lanling.common.config

import `in`.srain.cube.util.UTUtil
import android.os.Build
import com.xiaoyu.lanling.BuildConfig
import java.util.*

object HeaderConfig {

    private const val PRODUCT_IDENTIFIER = "Right-Android"

    val userAgent by lazy {
        val versionName = BuildConfig.VERSION_NAME
        val channelId: String = UTUtil.getInstance().channelId
        val manufacturer = Build.MANUFACTURER
        val model = Build.MODEL
        val release = Build.VERSION.RELEASE
        val sdkInt = Build.VERSION.SDK_INT

        String.format(Locale.CHINA, "%s/%s %s (%s, %s, %s; %d)", PRODUCT_IDENTIFIER, versionName, channelId, manufacturer, model, release, sdkInt)
    }
}